package top.yuyufeng.learn.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.yuyufeng.learn.dao.GoodInfoDao;
import top.yuyufeng.learn.dao.UserInfoDao;
import top.yuyufeng.learn.modal.GoodInfo;
import top.yuyufeng.learn.modal.UserInfo;

import java.util.List;

/**
 * @author yuyufeng
 * @date 2018/5/17.
 */
@Service
public class MyService {
    @Autowired
    private GoodInfoDao GoodInfoDao;
    @Autowired
    private UserInfoDao userInfoDao;

    public void findUserAndGoods(){
        List<UserInfo> userInfoList = userInfoDao.selectAll();
        for (UserInfo userInfo : userInfoList) {
            System.out.println(userInfo);
        }
        List<GoodInfo> goodInfoList = GoodInfoDao.selectAll();
        for (GoodInfo goodInfo : goodInfoList) {
            System.out.println(goodInfo);
        }
    }
}
